<?php

namespace App\Http\Controllers\Customer;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Query\GoodsDetailQuery;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cookie;

class JapanCartBuyController extends Controller
{


    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $user_id = Cookie::get('user_id');
        $user_name = Cookie::get('user_name');
        $corp_id = Cookie::get('corp_id');

        $shopList = DB::table('shop_master')->where(['corp_id' => $corp_id])->get();

        $list = DB::table('user_cart')->where(['user_id' => $user_id])->get();
        return view('customer.cart_buy', array(
            'list' => $list,
            'order_id' => 'NOU.' . rand(111111111, 999999999),
            'shop_list' => $shopList,
        )); // 返回视图
    }

}
